Skip to content

Add CLI update support - #6

Merged
GuoMonth merged 2 commits into
mainfrom
feat/update-check-planning
Apr 14, 2026
Merged

GuoMonth merged 2 commits into
mainfrom
feat/update-check-planning

Conversation

@GuoMonth

Copy link
Copy Markdown
Owner

Summary

  • add gm update check and gm update apply commands backed by GitHub Releases
  • trigger non-blocking background update checks from normal commands with a 24 hour cache window
  • keep update notices on stderr so stdout JSON remains stable

Details

  • resolve platform-specific release assets by OS and architecture
  • verify downloaded archives with GitHub asset digests before applying updates
  • use safe self-update replacement for the current binary
  • document the new update workflow in the README and CLI spec

Validation

  • go test -race -count=1 ./...
  • GOOS=windows GOARCH=amd64 go build ./cmd/gm
  • GOOS=linux GOARCH=amd64 go build ./cmd/gm

GuoMonth and others added 2 commits April 14, 2026 16:19
Introduce GitHub-release-backed update checking and apply commands, including non-blocking background checks for normal commands, stderr-only update hints, platform-specific asset resolution, checksum verification, and self-update installation. Update the README and CLI spec to document the new workflow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address CI lint failures in the update implementation by tightening error handling, using context-aware process creation, reducing parameter copying, and keeping line lengths within repository limits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GuoMonth
GuoMonth merged commit cfa6c0e into main Apr 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant